<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="org.hibernate.Transaction"%>
<%@page import="org.hibernate.Query"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="com.fick.hibernate.model.*"%>
<%@ page import="com.fick.hibernate.dao.*"%>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'isGrayAction.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <center>
    	<br><br><br><br><br><br><br>
    	<%  
    	String isGray = request.getParameter("isGray");
    	BaseHibernateDAO dao = new BaseHibernateDAO();
    	List isList = dao.findBySql(IsGray.class,"");
    	if(isList!=null&&isList.size()>0){
    		IsGray is = (IsGray)isList.get(0);
    		System.out.println(is.getId());
    		System.out.println(is.getIsGray());
    		is.setIsGray(isGray);
    		dao.update(is);
    %>
    	<font color=red>修改成功</font>
    <%		
    	}else{
    %>
    	<font color=red>失败了 , 再试一次</font>
    <%		
    	}    	
     %>
    </center>
  </body>
</html>
